import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";
import { headers } from 'next/headers';

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-inter",
});

export const metadata: Metadata = {
  title: "江苏苏科会计服务有限公司",
  description: "专业的会计服务提供商，提供注册公司、代理记账、税务筹划等服务",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  const headersList = headers();
  const pathname = headersList.get("x-pathname") || "/";
  const isHomePage = pathname === "/";

  return (
    <html lang="zh-CN">
      <body className={`${inter.variable} font-sans`}>
        <Navbar />
        <main className={`min-h-screen ${!isHomePage ? 'pt-16' : ''}`}>
          {children}
        </main>
        <Footer />
      </body>
    </html>
  );
}
